package com.tj.collection.controller.admin.request;


import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.CollectionUtils;
import com.fqgj.exception.common.ApiIllegalArgumentException;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2016/11/22
 * Time: 下午3:09
 */
public class AddAdminRoleVo extends ParamsObject {

    private Long adminId;
    private List<Long> roleIds;


    public Long getAdminId() {
        return adminId;
    }

    public AddAdminRoleVo setAdminId(Long adminId) {
        this.adminId = adminId;
        return this;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public AddAdminRoleVo setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
        return this;
    }

    @Override
    public void validate() {
        if (adminId == null || CollectionUtils.isEmpty(roleIds)) {
            throw new ApiIllegalArgumentException("管理员和权限都不能为空");
        }
    }
}
